package com.scetop.bank;

import java.util.ArrayList;
import java.util.Iterator;

public class Bank {
    //    private Customer [] customers;
    public ArrayList<Customer> customers;
    private int numberOfCustomers;

    public Bank(){
        customers = new ArrayList<>();
        numberOfCustomers = 0;
//        customers = new Customer[10];
    }

    private static Bank bank = new Bank();

    public static Bank getBank(){
        return bank;
    }
    public void addCustomer(String f,String l){
//        Customer customer = new Customer(f, l);
//        customers[numberOfCustomers] = customer;
//        numberOfCustomers++;

        customers.add(new Customer(f,l));
    }

    public int getNumOfCustomers() {
//        return numberOfCustomers;
        return customers.size();
    }

    public Customer getCustomer(int index){
        return customers.get(index);
    }
    public Iterator<Customer> getCustomers(){
        return customers.iterator();
    }
}

